Set the Folder Location for Automatically Exported Run Results
Source code
'************************************************************************************************************************
'Description:
'
'This example opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'
'Assumptions:
'There is no unsaved test currently open in OpenText Functional Testing.
'For more information, see the example for the Test.SaveAs method.
'When OpenText Functional Testing opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'************************************************************************************************************************
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
Dim qtAutoExportResultsOpts 'As QuickTest.AutoExportReportConfigOptions ' Declare the Automatically Export Report Configuration Options object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start OpenText Functional TestingqtApp.Visible = True ' Make the OpenText Functional Testing application visible
' Set OpenText Functional Testing run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"

qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "C:\Tests\Test1", True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Indicates that the next step should be performed when error occurs
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location
' Set options for automatic export of run results at the end of every run session

qtApp.Options.Run.ReportFormat = "RRV" ' Specifies the report should be created in RRV format
Set qtAutoExportResultsOpts = qtApp.Options.Run.AutoExportReportConfig qtAutoExportResultsOpts.AutoExportResults = True ' Specifies the run results should be automatically exported at the end of each run session qtAutoExportResultsOpts.StepDetailsReport = True ' Specifies the step details part of the run results should automatically be exported at the end of each run session qtAutoExportResultsOpts.DataTableReport = True ' Specifies the data table part of the run results should automatically be exported at the end of each run session qtAutoExportResultsOpts.LogTrackingReport = True 'Specifies the log tracking part of the run results should automatically be exported at the end of each run session qtAutoExportResultsOpts.ScreenRecorderReport = True ' Specifies the screen recorder part of the run results should automatically be exported at the end of each run session qtAutoExportResultsOpts.SystemMonitorReport = False 'Specifies the system monitor part of the run results should not be exported at the end of each run session qtAutoExportResultsOpts.ExportLocation = "C:\Documents and Settings\All Users\Desktop" 'Specifies the run results should be automatically exported to the Desktop at the end of each run session qtAutoExportResultsOpts.UserDefinedXSL = "C:\Documents and Settings\All Users\Desktop\MyCustXSL.xsl" ' Specifies the customized XSL file when exporting the run results data qtAutoExportResultsOpts.StepDetailsReportFormat = "UserDefined" ' Use a customized XSL file when exporting the run results data qtAutoExportResultsOpts.ExportForFailedRunsOnly = True ' Specifies the run results should be automatically exported only for failed runs qtTest.Run qtResultsOpt ' Run the test MsgBox qtTest.LastRunResults.Status ' Check the results of the test run qtTest.Close ' Close the test Set qtResultsOpt = Nothing ' Release the Run Results Options object Set qtTest = Nothing ' Release the Test object Set qtApp = Nothing ' Release the Application object Set qtAutoExportSettings = Nothing ' Release the Automatically Export Report Configuration Options object